@file:Suppress("UNCHECKED_CAST")
package moe.fuqiuluo.api

import com.tencent.mobileqq.channel.SsoPacket
import com.tencent.mobileqq.sign.QQSecuritySign

fun requestToken(uin: Long): ArrayList<SsoPacket> {
        val session = findSession(uin)
        val vm = session.vm
        if ("HAS_SUBMIT" !in vm.global) {
            throw RuntimeException("QSign not initialized, unable to request_token, please submit the initialization package first.")
        } else {
            val list = arrayListOf<SsoPacket>()
            session.withLock {
                QQSecuritySign.requestToken(vm)
            }
            return list
        }
}